<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h2>{{reverse?'dirow.olleh':'Hello.World'}}</h2>
        <button @click="toggleMsg">逆转世界</button>
    </div>
    <!-- 导入js -->
    <script src="./vue.js"></script>
    <script>
        // 创建vue实例
        const app = new Vue({
            el: '#app',
            data: {
                reverse: false,
            },
            methods: {
                toggleMsg() {
                    this.reverse = !this.reverse
                }
            }
        })
    </script>
</body>


</html>